package com.example.szh.entity;

import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;

import java.util.ArrayList;
import java.util.List;

public class LiveEntity extends BaseEntity{
    public String values;


    public List<Values> getValues() {

        if (values==null)
            return null;
        List<Values> list=new ArrayList<>();
        try {
            JSONArray jsonArray=new JSONArray(values);
            for (int i = 0; i < jsonArray.length(); i++) {
                String str = jsonArray.getString(i);
                Values values = new Gson().fromJson(str, Values.class);
                list.add(values);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return list;
    }

    public static class Values{
        public long live_id;
        public long live_time;
        public String live_img;
        public String live_title;
        public String live_url;
        public int live_fabulous;
    }
}
